package com.edgelight.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.io.Serializable;
import java.util.List;

/**
 * 评论表(SgComment)实体类
 *
 * @author makejava
 * @since 2022-08-26 23:36:57
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sg_comment")
public class SgComment implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)

    private static final long serialVersionUID = 127316836817879861L;
    
    private Long id;
    /**
     * 评论类型（0代表文章评论，1代表友链评论）
     */
    private String type;
    /**
     * 文章id
     */
    private Long articleId;
    /**
     * 根评论id
     */
    private Long rootId;
    /**
     * 评论内容
     */
    private String content;
    /**
     * 所回复的目标评论的userid
     */
    private Long toCommentUserId;
    /**
     * 回复目标评论id
     */
    private Long toCommentId;
    
    private Long createBy;
    //这个评论的发出人是谁

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date createTime;
    
    private Long updateBy;
    
    private Date updateTime;
    /**
     * 删除标志（0代表未删除，1代表已删除）
     */
    private Integer delFlag;

    private List<SgComment> children;
    //子评论合集

}

